<?
include("common/header.html");
include("../_made/le.cfg.php");
include("common/left.html");
include("common/page.php");
if(!$_SESSION['memberID']){exit("<script>window.location='dlogin.html'</script>");}
$currentPage=$_REQUEST["currentPage"]?$_REQUEST["currentPage"]:1;
$pageSize=$_REQUEST['pageSize']?$_REQUEST["pageSize"]:20;
$tplid=$unum=$t_sort=array();
$sel="select * from uu_fx_pri_tpl where distid=".$_SESSION['memberID']." limit ".($currentPage-1)*$pageSize.",".$pageSize;
$GLOBALS['le']->query($sel);
while($row=$GLOBALS['le']->fetch_assoc()){
	$t_sort[]=$row;
	$tplid[]=$row['id'];
}
$total=count($tplid);
if($tplid){
	$sel="select count(*) as unum,tplid from uu_fx_tpl_cs left join pft_member on id=fxid where status=0 and tplid in (".implode(",",$tplid).") group by tplid";
	$GLOBALS['le']->query($sel);
	while($row=$GLOBALS['le']->fetch_assoc()){
		$unum[$row['tplid']]=$row['unum'];
	}
}
include("tpl/tpllist_d.html");
include("common/footer.html");?>